package com.example.programexpert

import android.os.Bundle
import android.widget.TextView
import androidx.activity.ComponentActivity

class SecondActivity : ComponentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second2)

        // 获取传递过来的 Intent
        val intent = intent

        // 找到 TextView
        val textView = findViewById<TextView>(R.id.textView)

        // 设置文本内容，添加空安全处理
        val message = intent.getStringExtra(FIRST_MSG) ?: "No message received"
        textView.text = message
    }
}